<script>
import CargoTeamList from './CargoTeamList.vue'
import CargoGroupList from './CargoGroupList.vue'
import CargoGroupMemberList from './CargoGroupMemberList.vue'

export default {
  name: 'CargoSettings',
  components: { CargoGroupMemberList, CargoGroupList, CargoTeamList },
  data() {
    return {
      cargoGroupMainId: '',
      cargoGroupMemberMainId: ''
    }
  },
  methods: {
    onTeamSelectChange({ cargoGroupMainId }) {
      this.cargoGroupMainId = cargoGroupMainId
      // this.cargoGroupMemberMainId = ''
    },
    onGroupSelectChange({ cargoGroupMemberMainId }) {
      this.cargoGroupMemberMainId = cargoGroupMemberMainId
    }
  }
}
</script>

<template>
  <a-row :gutter="10">
    <a-col :md="8" :sm="24">
      <a-card :bordered="false" title="装货班组">
        <cargo-team-list @selection-change="onTeamSelectChange" />
      </a-card>
    </a-col>
    <a-col :md="8" :sm="24">
      <a-card :bordered="false" title="装货小组">
        <cargo-group-list @selection-change="onGroupSelectChange" :mainId="cargoGroupMainId" />
      </a-card>
    </a-col>
    <a-col :md="8" :sm="24">
      <a-card :bordered="false" title="小组成员">
        <cargo-group-member-list :mainId="cargoGroupMemberMainId" />
      </a-card>
    </a-col>
  </a-row>
</template>

<style scoped>

</style>